<template>
    <section>
        <el-col>
            <el-table :data="ProductItemData">
                <el-table-column label="编号" prop="ProductItemName">
                </el-table-column>
                <el-table-column prop="ProductItemPrice" label="价格"></el-table-column>
                <el-table-column prop="ProductItemOwner" label="货主"></el-table-column>
                <el-table-column prop="ProductItemMarket" label="营销中心"></el-table-column>
                <el-table-column inline-template width="130px">
                    <template>
                        <el-tooltip class="tip" placement="top" content="编辑商品库存项">
                            <el-button type="primary" size="small" icon="edit" @click="productItemEdit"></el-button>
                        </el-tooltip>
                        <el-tooltip class="tip" placement="top" content="删除商品库存项">
                            <el-button type="danger" size="small" icon="delete"></el-button>
                        </el-tooltip>
                    </template>
                </el-table-column>
            </el-table>
            <el-col :span="24" class="lastCol">
                <el-button type="primary" @click="addProductItem">添加商品库存项</el-button>
            </el-col>
        </el-col>
    </section>
</template>
<script>
    export default {
        data() {
            return {
                ProductItemData: [{
                    ProductItemName: '梨-11111111',
                    ProductItemPrice: '1234(元)',
                    ProductItemOwner: '我们',
                    ProductItemMarket: '上海配销中心'
                }], 
            }
        },
        methods: {
            productItemEdit() {
                this.$router.push('/products/undefined/product_items/:product_item_id/edit');
            },
            addProductItem() {
                this.$router.push('/products/undefined/product_items/new');
            },
            
        }
    }

</script>